package com.flute.tools.timer;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.StatefulJob;

public class StatefulTimerTask implements StatefulJob{
	public StatefulTimerTask() {

	}

	/**
	 * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
	 */
	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		Task task = (Task) context.getJobDetail().getJobDataMap().get(
				FlexTimer.TASK);
		FlexTimer.logger.info("timer '" + task.getId()
				+ "' start a new polling");
		task.getMethod().run();
		FlexTimer.logger.info("timer '" + task.getId() + "' end a new polling");
	}
}
